import numpy as np

# 1.创建 3列x3行 范围数组
x = np.arange(1,10,1).reshape(3,3)
print(x)
'''
[[1 2 3]
 [4 5 6]
 [7 8 9]]
'''

# 2.行,列索引 获取1,5,8元素
a=x[
    [0,1,2],
    [0,1,1]
]
print(a)
'''
[1 5 8]

'''


# 3.行,列索引 获取第5,7个元素
a=x[1][1]
b=x[2][0]
print(a,b)
'''
5 7
'''